package com.glink.manage.dto.menu;

import com.glink.common.contants.BaseCodeConstants;
import com.glink.common.contants.BaseConstants;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class MenuSaveRequestDTO {

    @ApiModelProperty(value = "菜单名", required = true)
    @NotBlank(message = "菜单名不能为空")
    @Size(max = 250, message = "菜单名超出限制，长度限制250位")
    private String menuName;

    @ApiModelProperty(value = "资源排序索引")
    @Max(value = 1000, message = "资源排序索引超出限制，大小限制1000位")
    private int idx;

    @ApiModelProperty(value = "菜单路径")
    private String uri;

    @ApiModelProperty(value = "上一级菜单id")
    private String pid;

    @ApiModelProperty(value = "键值标识")
    @Size(max = 250, message = "键值标识超出限制，长度限制250位")
    private String key;

    @ApiModelProperty(value = "是否启用菜单,默认不启用,0-不启用,1-启用")
    @Pattern(regexp = BaseCodeConstants.CodeType_WhetherCode.KEY_WhetherCode01
            + BaseConstants.REGEXP_STRING + BaseCodeConstants.CodeType_WhetherCode.KEY_WhetherCode02)
    private String isEnable;

    @ApiModelProperty(value = "是否在新页面打开,默认不打开,0-不打开,1-打开")
    @Pattern(regexp = BaseCodeConstants.CodeType_WhetherCode.KEY_WhetherCode01
            + BaseConstants.REGEXP_STRING + BaseCodeConstants.CodeType_WhetherCode.KEY_WhetherCode02)
    private String isPage;

    @ApiModelProperty(value = "资源类型(字典MenuResourceType):01-菜单,02-按钮,03-页面快捷方式,04-首页小面板")
    private String type;

}
